<?php

namespace app\admin\controller\finance;

use app\admin\model\UM as UM;
use app\admin\service\StatisticsService;
use ShidianUtil\Thinkphp\Response\ApiResponse;
use think\APP;
use think\Request as Request;

/**
 * Statistics 控制器
 * Class Statistics
 * @package app\admin\controller\finance;
 * @link https://www.kancloud.cn/manual/thinkphp6_0/1037509
 */
class Statistics
{
    // 请求参数
    private Request $request;

    // service
    private StatisticsService $service;

    public function __construct(Request $request, StatisticsService $statisticsService)
    {
        $this->request = $request;
        $this->service = $statisticsService;
    }

    /**
     * 统计
     * @return ApiResponse
     * @url /finance/statistics/read
     */
    public function read(): ApiResponse
    {
        $request = $this->request;

        return ApiResponse::success($this->service->read($request->param()));
    }

}
